import React, { useState } from "react"
import style from "./index.module.scss"
import Lgoin from "./login"
import Register from "./register"
import { PropsTypes } from "./type"
interface mainFace {
    isShowLogin: boolean
}
const defaultState: mainFace = {
    isShowLogin: false
}
const Main: React.FC<PropsTypes> = () => {
    const [state, setState] = useState<mainFace>(defaultState)

    const hanclechange = (e: boolean) => {
        setState(() => ({ isShowLogin: e }))
    }
    return (
        <div className={style.login}>
            <div className={style.login_box}>
                {
                    state.isShowLogin ? (<Register changeType={hanclechange}  ></Register>) : (<Lgoin changeType={hanclechange}  ></Lgoin>)
                }

            </div>

        </div>
    )
}
export default Main